Skip to content

test: fix flaky Windows CI failures in statistics and browser-pool tests#1947

Open
vdusek wants to merge 1 commit into
masterfrom
test/fix-flaky-windows-statistics-and-browser-launch
Open

test: fix flaky Windows CI failures in statistics and browser-pool tests#1947
vdusek wants to merge 1 commit into
masterfrom
test/fix-flaky-windows-statistics-and-browser-launch

Conversation

@vdusek
Copy link
Copy Markdown
Collaborator

@vdusek vdusek commented Jun 4, 2026

Two unit tests flaked on a master push build (run, windows-latest, Python 3.10).

  • test_crawler_intermediate_statisticspoll_until_condition(lambda: crawler.statistics.active) used the helper's default 5s ceiling. Under xdist load on a slow Windows runner, crawler startup didn't reach the active state in time, so the poll returned False. Pass a generous timeout=30 (the happy path still returns in <1s, so there's no cost on green runs).
  • test_with_default_plugin_constructor — launching a real Firefox browser timed out even with operation_timeout=60s while competing with other xdist workers on the constrained Windows runner. The existing @run_alone_on_mac only isolated macOS, so Windows still ran it in the parallel pool. Upgraded to @pytest.mark.run_alone so the heavy browser launch gets the full machine on every platform; the 60s timeout is kept.

Both flakes are Windows-resource-specific, so local Linux re-runs (10/10 and 5/5 green) confirm the fixes are valid but can't reproduce the original failure mode — CI re-verifies the Windows path.

Give the statistics poll a generous timeout so crawler startup can reach the active state on slow CI, and run the resource-heavy Firefox launch test in isolation so it stops timing out under xdist contention.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Jun 4, 2026
@vdusek vdusek self-assigned this Jun 4, 2026
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 4, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jun 4, 2026
@vdusek vdusek requested a review from janbuchar June 4, 2026 13:44
@vdusek vdusek marked this pull request as ready for review June 4, 2026 13:45
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.02%. Comparing base (76927d7) to head (583b47a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1947      +/-   ##
==========================================
+ Coverage   92.98%   93.02%   +0.04%     
==========================================
  Files         167      167              
  Lines       11712    11712              
==========================================
+ Hits        10890    10895       +5     
+ Misses        822      817       -5     
Flag Coverage Δ
unit 93.02% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants